﻿#Const DEBUG = True

Public Class Test_CheckTCP
    Private WithEvents X As New PurpleKnife.Library.CheckTCP()
    Private WithEvents Y As New PurpleKnife.Library.CheckTCP()

    Private Sub btnDoCheck_Click(sender As System.Object, e As System.EventArgs) Handles btnDoCheck.Click

        X.PerformCheck(New System.Net.IPEndPoint(System.Net.IPAddress.Parse(txtIPAddress.Text), Integer.Parse(txtPort.Text)))
        'Y.PerformCheck(New System.Net.IPEndPoint(System.Net.IPAddress.Parse("45.6.7.8"), Integer.Parse("22")))
    End Sub

    Private Sub X_CheckCompleted(sender As Object, e As Library.CheckTCP.CheckCompletedEventArgs) Handles X.CheckCompleted
        Debug.Print("X Success: " & e.Success)
        MsgBox("TCP Check success: " & e.Success)
    End Sub

    Private Sub Y_CheckCompleted(sender As Object, e As Library.CheckTCP.CheckCompletedEventArgs) Handles Y.CheckCompleted
        Debug.Print("Y Success: " & e.Success)
        MsgBox("TCP Check success: " & e.Success)
    End Sub
End Class